package com.wing.purchase.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.purchase.model.entity.PurchaseOrder;
import com.wing.purchase.model.request.PurchaseOrderForm;
import com.wing.purchase.model.response.PurchaseOrderVO;

import java.util.List;
import java.util.Map;

/**
 * 采购订单-Service
 *
 * @author
 */
public interface PurchaseOrderService extends IService<PurchaseOrder> {

    /**
     * 添加
     *
     * @param purchaseOrderForm
     * @return
     */
    int add(PurchaseOrderForm purchaseOrderForm);

    /**
     * 添加
     *
     * @param purchaseOrder
     * @return
     */
    int update(PurchaseOrder purchaseOrder);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<PurchaseOrderVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<PurchaseOrderVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    PurchaseOrderVO get4appById(Long id);

    /**
     * 审核
     * @param purchaseOrder
     * @return
     */
    int audit(PurchaseOrder purchaseOrder);

    /**
     * 关闭
     * @param id
     * @return
     */
    int close(Integer id);

    /**
     * 删除
     * @param purchaseOrderId
     * @return
     */
    boolean delete(Long purchaseOrderId);

    /**
     * 采购订单详情
     * @param id
     * @return
     */
    PurchaseOrderVO detail(String id);
}
